package com.tvunetworks.center.device.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * @author Etan Yang
 * @create: 2021/10/13 16:04
 */
public interface UserDeviceMapper {
    /**
     *
     * @param userId userId
     * @param receiver receiver
     * @param pack pack
     * @param condition condition
     * @return List
     */
    List<String> listRPSDevice(@Param("userId") String userId, @Param("receiver") boolean receiver, @Param("pack") boolean pack, @Param("condition") String condition);

    /**
     *
     * 根据用户查询 token 配对的 grid id
     *
     * @param userId userId
     * @param condition condition
     * @return List
     */
    List<String> listUserTokenGridIds(@Param("userId") String userId, @Param("condition") String condition);

    /**
     *
     * @param tId tId
     * @return List
     */
    List<String> listTTokenPairR(@Param("tId") String tId);

    /**
     *
     * @param userId userId
     * @param condition condition
     * @param favorite favorite
     * @return  List
     * @throws Exception 编译异常
     */
    List<String> listRIds(@Param("userId")String userId, @Param("condition")String condition, @Param("favorite")String favorite) throws Exception;

    /**
     *
     * @param userId userId
     * @param typeList typeList
     * @param condition condition
     * @return  List
     * @throws Exception 编译异常
     */
    List<String> listPeerIds(@Param("userId")String userId, @Param("typeList")Collection<String> typeList, @Param("condition")String condition) throws Exception;

    /**
     *
     * @param rid rid
     * @param condition condition
     * @return List
     * @throws Exception  编译异常
     */
    List<String> listPairedTByR(@Param("rId")String rid,@Param("condition")String condition) throws Exception;

    /**
     *
     * @param userId userId
     * @return List
     */
    List<String> getBindTRPeerIdList(@RequestParam("userId") String userId);

    /**
     * 查询分享bookmark的父账号
     * @param id id
     * @return String
     */
    String  selectParentId(String id);

    /**
     *     //根据userId,获取device
     * @param userId userId
     * @return Set
     */
    //根据userId,获取device
    Set<String> getDeviceIdByUser(String userId);


}
